class Solution(object):
    def findSpecialInteger(self, arr):
        """
        :type arr: List[int]
        :rtype: int
        """
        n = len(arr)
        left = 0
        right = 0
        while right < n:
            if arr[right] != arr[left]:
                if right - left > n / 4:
                    return arr[left]
                left = right
            right += 1
        return arr[left]


data = Solution()
arr = [1, 2, 2, 6, 6, 6, 6, 7, 10]
print(data.findSpecialInteger(arr))
